<h1>
  <?php echo $essay->getTitle() ?>
  <br />
  by <?php echo link_to($author->getName(),'author_show',$author) ?>
</h1>
<p>
  <?php echo nl2br($essay->getContent()) ?>
<br />
  <?php if($sf_user->isAuthenticated()): ?>
    <?php if($essay->isFavorite($sf_user->getAttribute('user_id', null, 'sfGuardSecurityUser'))): ?>
      <a class="remove_fav" title="Remove essay from favorites" href="<?php echo url_for('profile/removeFavoriteEssay?essay_id='.$essay->getId()) ?>"></a>
    <?php else: ?>
      <a class="add_fav" title="Add essay to favorites" href="<?php echo url_for('profile/addFavoriteEssay?essay_id='.$essay->getId()) ?>"></a>
    <?php endif ?>

    <?php if($essay->isBookmark($sf_user->getAttribute('user_id', null, 'sfGuardSecurityUser'))): ?>
      <a class="remove_book" title="Remove essay from bookmarks" href="<?php echo url_for('profile/removeBookmarkEssay?essay_id='.$essay->getId()) ?>"></a>
    <?php else: ?>
      <a class="add_book" title="Add essay to bookmarks" href="<?php echo url_for('profile/addBookmarkEssay?essay_id='.$essay->getId()) ?>"></a>
    <?php endif ?>
  <?php endif ?>
</p>
